﻿
<script type="text/javascript">
    $('.chzn-drop').css('left', '0px');
    $('.chzn-drop').css('display', 'none');
    $('.chzn-single').on("click", function (e) {
        $(this).toggleClass('chzn-single-with-drop');
        $(this).next().toggleClass('visible');
        e.preventDefault();
    });
</script>

<style>
    table{
        font-size:16px;
    }
    .lsk-header{
            height: 75px;
            background-color: #df4a43;
            color: white;
            font-size: 18px;
            margin-top:5px;
            margin-bottom:5px;
    }

    #home-advanced-search.open .container, #map-property-filter.open .container, #advanced-search.open .container, #contacts-overlay.open .container
    {
        max-height:none!important;
    }


    .visible {
        display: block !important;
    }

    .chzn-results li:hover {
        background-color: #df4a43;
        color: white;
    }

    .form-group {
        width: 89%;
        text-align: left;
        margin: 0 auto;
    }

    .btn-fullcolor {
        width: 150px;
    }

    .table-active{
            max-height: 16000px!important;
    }

    .hidden{
        display:none;
    }

    @media only screen and (max-width: 990px) {
         table{
            display: table!important;
            margin-left:10px;
            text-align:left;
        }
    }

    table{
        display: inline-block;
        padding: 8px;
        vertical-align: top;
    }

    .pattern-bg{
        background-image: url("../images/banners/Calculator/home-loan-calculator.jpg");
        background-size: cover;
    }
    .pattern-bg.colored-bg:before{
        background-color: rgba(0,0,0,0.6);
    }
</style>

<!-- BEGIN PAGE TITLE/BREADCRUMB -->
<div class="parallax colored-bg pattern-bg" data-stellar-background-ratio="0.5">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <h1 class="page-title">Home Loan Calculator</h1>

                <!--<ul class="breadcrumb">
                    <li><a href="index.html">Home </a></li>
                    <li><a href="#">Properties</a></li>
                    <li><a href="properties-grid.html">Property Grid Listing</a></li>
                </ul>-->
            </div>
        </div>
    </div>
</div>
<!-- END PAGE TITLE/BREADCRUMB -->
<!-- BEGIN HOME ADVANCED SEARCH (class="gray" for a gray background) -->

<div id="advanced-search" class="gray open">

    <div ng-class="{ 'table-active': calc == true }" class="container" style="width:100%">

        <div class="row">
            <h3 style="max-width: 70%;margin: 0 auto;margin-top: 20px;font-size:17px;"">
                For specific advice on legal, financial or real estate matters, you should always seek the advice of a professional who is licensed and knowledgeable in that area, such as an attorney, accountant,real estate agent or Banker.
            </h3>
        </div>

        <form class="row">
            <form class="col-sm-12">

            
                <table>
                    <tbody>
                        <tr>
                            <td>
                                <label>Purchase Price (RM)</label>
                            </td>

                            <td>
                                <input class="form-control" id="txtPrice" type="number" ng-model="purchasePrice" tabindex="1" style="width: 100%" />
                            </td>
                        </tr>
                        <tr>

                            <td>
                                <label>Margin of Financing, MOF (%)</label>
                            </td>

                            <td>
                                <input class="form-control" id="txtMargin" type="number" ng-model="marginFinance" style="width: 100%" />
                            </td>

                        </tr>
                        <tr>

                            <td>
                                <label>Loan Amount (RM)</label>
                            </td>

                            <td>
                                <input value="0" id="txtLoan" class="form-control" type="number" ng-model="loanAmount" />
                            </td>

                        </tr>

                        <tr>
                            <td>
                                <label>MRTA (RM)</label>
                            </td>

                            <td>
                                <input class="form-control" id="txtMrta" type="number" ng-model="mrta" />
                            </td>

                        </tr>
                        <tr>
                            <td>
                                <label>Others (RM)</label>
                            </td>

                            <td>
                                <input id="txtOthers" type="number" class="form-control" ng-model="others" />
                            </td>

                        </tr>

                    </tbody>
                </table>

                <table style="width:408px;">
                    <tbody>
                        <tr>
                            <td>
                                <label>Total Loan Amount (RM)</label>
                            </td>
                            <td>
                                <input id="txtTotal" type="number" ng-model="total" class="form-control" />
                            </td>

                        </tr>
             
                        <tr>

                            <td>
                                <label>Interest/Profit Rate (%)</label>
                            </td>

                            <td>
                                <input id="txtInterestRate" class="form-control" ng-model="interestRate" type="number" tabindex="5" style="width: 100%" />
                            </td>

                        </tr>
                        <tr>

                            <td>
                                <label>Loan Tenure (years)</label>
                            </td>

                            <td>
                                <input id="txtTenure" type="number" class="form-control" ng-model="tenure" tabindex="6" style="width: 100%"/>
                            </td>

                        </tr>
                        <tr>
                            <td>
                                &nbsp;

                            </td>

                        </tr>
                    </tbody>
                </table>


                <table>
                    <tbody>
                        <tr style="border: 2px solid red;">

                            <td style="padding:20px">
                                <label>Monthly Repayment</label>
                            </td>

                            <td>
                                <span style="color:red; font-weight:bold;">
                                    {{ monthlyPayment | currency:"RM ":2  }}
                                </span>
                            </td>

                        </tr>
                        <tr>

                            <td style="padding-top:20px">
                                <label>Total Payment</label>
                            </td>

                            <td style="padding-top:20px;text-align: left;">
                                <span style="color:red">
                                    {{ totalPayment | currency:"RM ":2  }}
                                </span>
                            </td>

                        </tr>
                        <tr>

                            <td>
                                <label>Total Interest/Profit</label>
                            </td>

                            <td style="text-align:left">
                                <span style="color:red">
                                    {{ totalInterest | currency:"RM ":2  }}
                                </span>
                            </td>

                        </tr>
                        <tr>

                            <td>
                                <label>Monthly Interest</label>
                            </td>

                            <td style="text-align:left">
                                <span style="color:red">
                                    {{ monthlyInterest | currency:"RM ":2  }}
                                </span>
                            </td>
                        </tr>

                    </tbody>
                </table>
                <div style="margin-top:10px;">
                    <a class="btn btn-danger" style="padding-left: 25px;
                                                    padding-right: 25px;
                                                    background-color: transparent!important;
                                                    color: #df4a43!important;
                                                    border: 2px solid #df4a43;
                                                    font-size: 1em;" ng-click="clearValues()">Clear</a>
                    <a class="btn btn-danger" style="padding-left: 25px;
                                                    padding-right: 25px;
                                                    background-color: transparent!important;
                                                    color: #df4a43!important;
                                                    border: 2px solid #df4a43;
                                                    font-size: 1em;" ng-click="calculateOnly()">Calculate</a>
                    <a class="btn btn-danger" style="padding-left: 25px;
                                                    padding-right: 25px;
                                                    background-color: transparent!important;
                                                    color: #df4a43!important;
                                                    border: 2px solid #df4a43;
                                                    font-size: 1em;" ng-click="generateTable()">Open PDF</a>
                </div>
            </form>
          </form>


        <div id="dvAmortization" ng-show="calc">
            <table id='tblAmortization' class="table table-striped table-hover table-bordered">
                <tbody>
                    <tr><td>Month</td><td>Loan Balance</td><td>Principle Balance</td><td>Interest</td></tr>
                    <tr ng-repeat="payment in payments">
                        <td>{{payment.month}}</td>
                        <td>{{payment.loan_balance | number :2}}</td>
                        <td>{{payment.monthly_principle_balance  | number :2}}</td>
                        <td>{{payment.monthly_interest | number :2}}</td>
                    </tr>

                </tbody>
            </table>


        </div>
        <ul ng-class="{ 'hidden': calc == false }" uib-pagination boundary-links="true" total-items="totalItems" ng-model="currentPage" num-pages="numPerPage"></ul>





            

      </div>
</div>

<!-- END HOME ADVANCED SEARCH -->
<!-- BEGIN CONTENT WRAPPER -->
<!--<div class="content">
    <div class="container">
        <div class="row">

            <div class="main col-sm-12">

             
                <h3> Search results </h3>
                <table class="table table-striped table-hover table-bordered">
                    <thead>
                        <tr>
                            <th>Address</th>
                            <th>Project Name</th>
                            <th>Price</th>
                            <th>Land Type</th>
                            <th>Property Type</th>
                            <th>Land(m.sq)</th>
                            <th>Build Up(m.sq)</th>
                            <th>Trasaction Date</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="obj in objects | filter : paginate">
                            <td>{{obj.Alamat}}</td>
                            <td>{{obj.Daerah}}</td>
                            <td>{{obj.Price}}</td>
                            <td>{{obj.LandType}}</td>
                            <td>{{obj.PropertyType}}</td>
                            <td>{{obj.Land}}</td>
                            <td>{{obj.BuildUp}}</td>
                            <td>{{obj.TransactionDate | date:"MM/dd/yyyy"}}</td>
                        </tr>
                    </tbody>
                </table>
                
                <!--<div lskpagination total-items="totalItems" ng-model="currentPage"
                                max-size="5" boundary-links="true"
                                items-per-page="numPerPage" class="pagination-sm">
                </div>-->

                <!--<ul uib-pagination  boundary-links="true" total-items="totalItems" ng-model="currentPage" num-pages="numPerPage"></ul>-->


                <!--<lskpagination num-pages="numPerPage" current-page="currentPage" class="pagination-small"></lskpagination>-->

                <!--<div>
                    <table ng-table="tableParams" class="table table-striped" show-filter="true">
                        <tr ng-repeat="data in $data">
                            <td data-title="'Address'" sortable="'Address'" class="col-md-2" filter="{ 'Address': 'text'}">{{data.Alamat}}</td>
                            <td data-title="'Project Name'" sortable="'Kawasan'" class="col-md-2" filter="{ 'Kawasan': 'text'}">{{data.Kawasan}}</td>
                            <td data-title="'Price'" sortable="'Price'" align="center" class="col-md-1" filter="{ 'Price': 'text'}">{{data.Price | number}}</td>
                            <td data-title="'Land Type'" sortable="'LandType'" class="col-md-1" filter="{ 'LandType': 'text'}">{{data.LandType}}</td>
                            <td data-title="'Property Type'" sortable="'PropertyType'" class="col-md-1" filter="{ 'PropertyType': 'text'}">{{data.PropertyType}}</td>
                            <td data-title="'Land Area(m.sq)'" sortable="'Land'" align="center" class="col-md-1" filter="{ 'Land': 'text'}">{{data.Land}}</td>
                            <td data-title="'Build Up(m.sq)'" sortable="'BuildUp'" align="center" class="col-md-1" filter="{ 'BuildUp': 'text'}">{{data.BuildUp}}</td>
                            <td data-title="'Transaction Date'" sortable="'TransactionDate'" align="right" class="col-md-1" filter="{ 'TransactionDate': 'text'}">{{data.TransactionDate  | date:"MM/dd/yyyy"}}</td>
                        </tr>
                        <tr>
                            <td><strong>Count per page:</strong> {{tableParams.count()}}</td>
                            <td colspan="8" align="right">
                                <p><strong>Page:</strong> {{tableParams.page()}} </p>
                            </td>
                        </tr>

                    </table>
                </div>-->

            </div>


        </div>
    </div>
</div>
<!-- END CONTENT WRAPPER -->